package d1109;

public  abstract class Animal {
    private String name;
    public  Animal(String name){
        this.name=name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    public  abstract   void shout();
}
class Cat extends Animal{
    public Cat(String name){
        super(name);
    }
    @Override
    public  void shout(){
        System.out.println("喵喵喵");
    }
}
class Dog extends Animal{
    public Dog(String name){
        super(name);
    }
    @Override
    public void shout(){
        System.out.println("汪汪汪");
    }

}
